Component({
  /**
   * 组件的属性列表
   */
  properties: {
    detail:String
  },

  /**
   * 组件的初始数据
   */
  data: {
    details: ''
  },
  ready () {
    var that = this
    setTimeout(function () {
      that.setDetails()
    }, 800)
  },
  /**
   * 组件的方法列表
   */
  methods: {
    setDetails() {
      var details = this.formatRichText(this.properties.detail)
      this.setData({
        details: details
      })
    },
    formatRichText(html){
      var deschtml = html.replace(/\<img/g,'<img style="width:100%;height:auto;"');
      return deschtml;
    }
  }
})
